<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:forEach items="${menus}" var="menu" varStatus="status">
     <c:if test="${menu.parentId == null && menu.showFlag eq '1'}">
		 <li class="layui-nav-item <c:choose><c:when test="${status.index ==0}">layui-nav-itemed</c:when><c:otherwise>layui-nav-iteme</c:otherwise></c:choose>">
			 <c:choose>
				 <c:when test="${menu.hasMenuChildren}">
					 <a class="" href="#"><i class="fa ${menu.menuIcon}" aria-hidden="true"></i><span> ${menu.name}</span></a>
					 <dl class="layui-nav-child">
						 <c:forEach items="${menus}" var="secondMenu">
							 <c:if test="${secondMenu.parentId == menu.id && secondMenu.showFlag eq '1'}">
								 <dd>
									 <c:if test="${!secondMenu.hasMenuChildren}">
										 <a href="javascript:;" kit-target data-options="{url:'<c:if test="${not empty appPath && not empty secondMenu.url}">${appPath}/</c:if>${secondMenu.url}',icon:'${secondMenu.menuIcon}',title:'${secondMenu.name}',id:'${secondMenu.id}'}">
											 <i class="fa ${secondMenu.menuIcon}"></i><span> ${secondMenu.name}</span></a>
									 </c:if>
									 <c:if test="${secondMenu.hasMenuChildren}">
										 <a href="javascript:;"  data-options="{url:'<c:if test="${not empty appPath && not empty secondMenu.url}">${appPath}/</c:if>${secondMenu.url}',icon:'${secondMenu.menuIcon}',title:'${secondMenu.name}',id:'${secondMenu.id}'}">
											 <i class="fa ${secondMenu.menuIcon}"></i><span> ${secondMenu.name}</span></a>
										 <!--  三级菜单 -->
										 <dl  class="layui-nav-child">
											 <c:forEach items="${menus}" var="thirdMenu">
												 <c:if test="${thirdMenu.parentId == secondMenu.id && thirdMenu.showFlag eq '1'}">
													 <dd>
														 <a href="javascript:;" kit-target data-options="{url:'<c:if test="${not empty appPath && not empty thirdMenu.url}">${appPath}/</c:if>${thirdMenu.url}',icon:'${thirdMenu.menuIcon}',title:'${thirdMenu.name}',id:'${thirdMenu.id}'}">
															 <i class="fa ${thirdMenu.menuIcon}"></i><span> ${thirdMenu.name}</span></a>
													 </dd>
												 </c:if>
											 </c:forEach>
										 </dl>
									  </c:if>

								 </dd>
							 </c:if>
						 </c:forEach>
					 </dl>
				 </c:when>
				 <c:otherwise>
					 <a class="" href="${webRoot}/${menu.url}"><i class="fa ${menu.menuIcon}" aria-hidden="true"></i><span> ${menu.name}</span></a>
				 </c:otherwise>
			 </c:choose>

     </c:if>
</c:forEach>